austriamicrosystems AG is now ams AG The technical content of this austriamicrosystems application note is still valid. Contact information: Headquarters: ams AG Tobelbaderstrasse 30 8141 Unterpremstaetten, Austria Tel: +43 (0) 3136 500 0 e-Mail: ams_sales@ams.com Please visit our website at www.ams.com AS5045 / AS5145 Demoboard Operation Manual 1 General Overview lv al id The AS5045/AS5145A/B is a contactless magnetic rotary encoder for accurate angular measurement over a full turn of 360. It is a system-on-chip, combining integrated Hall elements, analog front end and digital signal processing in a single device. To measure the angle, only a simple two-pole magnet, rotating over the center of the chip, is required. The magnet may be placed above or below the IC. The absolute angle measurement provides instant indication of the magnet's angular position with a resolution of 0.0879 = 4096 positions per revolution. This digital data is available as a serial bit stream and as a PWM signal. An internal voltage regulator allows the AS5045/AS5145A/B to operate at either 3.3 V or 5 V supplies am lc s on A te G nt st il Note: AS5145A/B are pre-programmed versions of AS5145. It provides 10bit (A) or 12bit (B) incremental output. 2 The AS5045/AS5145A/B Demoboard The AS5x45 demoboard is a complete rotary encoder system with built-in microcontroller, USB interface, graphical LCD display and PWM output LED. The board is USB powered or externally supplied with a 9V battery for standalone operation. LCD display (for standalone mode) 9V battery connector (standalone only) Knob with D5x2.5mm diametral magnet, 2mm over the AS5x45 SiLabs C8051F320 microcontroller USB cable to the PC ca J6: External Encoder SSI Connector ni External (left) - Onboard (right) encoder selection switch SW1 Onboard AS5x45 output signals connector and indicators MagINCn, MagDECn (J7) and PWM (J4) only are available with AS5045 and AS5145 ch Figure 1: AS5x45 Demoboard hardware with mounted magnet knob 3 Operating the AS5045/AS5145A/B Demoboard Te The AS5x45 demoboard can be used in several ways: * As standalone unit supplied by a 9V battery Connect a 9V battery to the battery connector on the top right side of the board. No other connections are required. * As standalone unit supplied by an USB port Connect the demoboard to a PC using a USB/USB cable (included in demoboard shipment). The board is supplied by the 5V supply of the USB port. No other connections are required. * As input device for the AS5000 Programmer GUI software Revision 1.3, 22-Jul-2009 Page 1 of 12 www.austriamicrosystems.com AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL This configuration uses the same USB hardware connection as above, but additionally the AS5000 Programmer GUI software is running. The LCD display will be turned off and the Angle/Status bits will be displayed on the PC screen. Some extra features as zero position programming can be achieved. The parameters will not be permanently programmed. All the parameters will be lost when the demoboard is shut down. For a permanent device programming, the "AS5000 Programmer" hardware should be used. 3.1 Graphic LCD display al id The LCD display shows the realtime absolute angle position of the magnet with a resolution of 0.09 = 4096 positions per revolution (AS5045/AS5145A/B) and the absolute value of the angle. Turning the knob clockwise will increase the angle value until 359.9 (value 4095), then 0. The magnet status indicator is related to the magnet position. If the magnet is too close or too far away from the encoder, "Magnet out of range" will be displayed. Absolute angle value 12 bit resolution: 0 to 4095 Magnet angle value from 0 to 359.9 am lc s on A te G nt st il Bargraph representation of the angle (0 to 359.9) lv Magnet indicator: - Distance OK - Magnet out of range Figure 2: LCD display in standalone mode (9V battery or USB powered without GUI) 3.2 PWM LED The PWM LED is connected to the PWM output of the AS5045/AS5145A/B. The PWM output is a pulse width that is proportional to the angle of the magnet. The pulse width varies from 1s to 4096s with a repetition rate of 244Hz. Viewing the PWM signal on the LED results in brightness that is proportional to the angle of the magnet. When the angle of the magnet is at 0, the LED is almost dark, as it is 1s on and 4095s off. Turning the knob clockwise towards higher angles increases the brightness of the PWM LED, since the ON-pulse becomes longer and the OFF-pulse becomes shorter. Likewise, the PWM output can be used as an analog output proportional to the angle, when the PWM signal is filtered by a RC (or active) lowpass filter. 3.3 ca The PWM signal (digital 0 ~ 3.3V) can be directly taken from the connector J4. MagINc and MagDECn ni MagINCn and MagDECn are the magnetic field change indicators (magnetic field strength increase or decrease through variation of the distance between the magnet and the device). Te ch These outputs can be used to detect the valid magnetic field range. If both indicators lit simultaneously (MagINCn = 0 and MagDECn = 0), the magnet is out of range, the airgap between the encoder and the magnet is too high or too low. In that case, "Magnet out of range" will be displayed on the LCD display. Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 2 of 12 3.4 Encoder selection switch The switch SW1 selects the encoder which communicates with the microcontroller through the SSI bus: Right position (default): Onboard AS5045/AS5145A/B 2. Left Position: External AS5045/AS5145A/B connected on J6 The signals of the synchronous serial interface (DO, CLK, CSn, PROG) and the power supply (3.3V, GND) of an external device can be connected directly to J6. In this configuration, the data of the serial interface are displayed on the GUI or the LCD. al id 1. ca am lc s on A te G nt st il lv * In standalone mode, regardless to the demoboard type (AS5045, AS5145A/B), AS5045 and AS5145A/B can be attached to J6 and evaluated. See figure 3. * If the GUI is used for operation, additional devices AS5040, AS5140, AS5043 and AS5143 can be connected to J6 and evaluated. In that case, the correct encoder must be selected instead of "Autoselect" in the Device list of the PC software, see chapter 4.2 figure 4. Demoboard switched to external encoder mode Te ch ni Figure 3: external AS5045/AS5145A/B connection to the demoboard Revision 1.3, 22-Jul-2009 Page 3 of 12 www.austriamicrosystems.com 4 AS5000 Programmer GUI software 4.1 Installing the GUI on the PC The preliminary software is developed for a Microsoft Windows XP operating system with Service Pack 2. In addition the dotnet (.NET) framework version 2.0 or more must be installed on the PC. This package can be downloaded free of charge from the Microsoft webpage: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en 4.2 check on your PC if Service Pack 2 is installed install the mentioned .NET package to your computer execute setup.exe Finally start the GUI using the shortcut in the start menu or desktop. lv 1. 2. 3. 4. al id Following Procedure is recommended before starting the GUI: The Home tab am lc s on A te G nt st il Figure 3 shows the main window of the GUI. On the top left corner, board information's as firmware (FW) version and demoboard name declaration can be found. By default the GUI is in the auto detection mode. Any connected austriamicrosystems demoboard and programming tool will be automatically detected and the device type is displayed in the right top corner of the main window. The GUI is divided into three main sections HOME, SSI and OTP. Te ch ni ca Device selection list: Change the encoder type if a different encoder type is connected externally on J6 and SW1 on left position Figure 4: AS5000 GUI has detected the AS5045 Demoboard Revision 1.3, 22-Jul-2009 Page 4 of 12 www.austriamicrosystems.com 4.3 The SSI tab By selecting the SSI (serial protocol for AS5040, AS5140, AS5043, AS5143, AS5045, AS5145A/B) tab, the real time information of the angular position and the status bits are displayed. See figure 4. Not used (dual die encoders only) al id Angle value: 12 bit absolute position: 0 to 4095 Status bits information am lc s on A te G nt st il lv Magnet range warning: - Green: magnet in Range - Orange: magnet too close or too far - Red: magnet to close or too far, data invalid (if MagCompEN = 1 only) Set counter clockwise Angle register value: Display update rate. The readout speed can be adjusted from 10ms to 1s Magnet angle value 0 to 359.9 Zero position register access: - Button SET: Sets the current angle as the 0 angle - Button RESET: resets the Zero Position register to 0 (default) Figure 5: SSI tab, shows the SSI bus data of the selected encoder Value is the Angle data [D11:D0] from the RD_ANGLE (Read Angle) serial command. This value is continuously updated. ca The Zero Pos. value represents the Zero Position register. By clicking on the Set button, the actual angle "Value" is written into the Zero Position register. Clicking on Reset writes the value 0 to the Zero Position register. ch ni The Magnetic Range Warning is continuously read from the RD_ANGLE serial command. * Green lamp: Magnet in range * Orange lamp: Magnet too far or too close. MagINC and MagDEC are set. * Red lamp: Magnet too far or too close, angle value is invalid and LIN bit is set. The red lamp is available only when OTP MagCompEN=1, available from the OTP tab. The Status bits information is taken from the serial stream. Te The Read Interval can be modified from 10 ms (fastest) to 1 s (slowest). Revision 1.3, 22-Jul-2009 Page 5 of 12 www.austriamicrosystems.com AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL 4.4 The OTP tab The OTP tab is normally used for the AS5000 programmer, but the OTP bits can be changed on the AS5x45 demoboard as well. Options like Zero Position, Pulses per revolution and Incremental Mode Selection can be changed by selecting the function in "Fields", then changing the parameter in "Options for the selected field" or directly the decimal value of this parameter in "Value". am lc s on A te G nt st il lv al id Each time a field's value has been changed, the corresponding OTP bits will be automatically checked in the right window. The button Write should be clicked to write the parameter into the AS5x45. The Read button reads back the OTP register, and updates the "Field" parameter as well as the OTP bits window. Figure 6: OTP tab ca Field Zero Position: To zero position value, like on the SSI tab. The zero position value can be changed by checking the Z[11:0] bits, or changing the Value field with a decimal number. Te ch ni Note: The Zap! button is used for the AS5000 Programmer only and has no effect on the AS5x45 Demoboard. Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 6 of 12 AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL 5 AS5045/AS5145A/B Demoboard, Schematics, Blockdiagramm U1 5V 7 RegIn P2.7 P2.6 P2.5 P2.4 P2.3 P2.2 P2.1 P2.0 3.3V 6 C4 100n GND C5 1u VDD 3 GND GND J2 ISP C2CK 1 2 3 4 3.3V Header 4 9 10 RST/C2CK P3.0/C2D C2D GND J3 1 2 3 4 VBUS DD+ GND USB 8 5 4 VBUS DD+ 440478-1 GND R9 1k DS3 LED_R LED_R DS7 DS6 DS5 LED_G LED_G LED_Y R12 1k R11 1k R10 1k C20 100n GND Prog 1 2 3 4 5 6 7 8 MagINCn MagDECn A_LSB_U B_DIR_V nc Index_W VSS Prog C25 10n VDD5V VDD3V3 nc nc PWM_LSB CSn CLK DO 16 15 14 13 12 11 10 9 GND B 3.3V GND R5 PWM Int_CSn Int_CLK Int_DO R4 4.7k AS5045 AS5040 AS5145 Analog_in 22k C18 1u GND DS1 LED3 D2 D1 J5 R3 68k GND BAT54 3 1 2 LL4001 9V Battery Vin Vout 2 3 AS1360-50 C23 10u C21 1u 3V Vin Vout GND 1 C22 22u GND U4 5V GND 1 Header 2 68R D3 BAS70-05 BL_A LCD Backlight R13 5V 33R DisplayTech32128a Int_DO SW1 J6 GND GND U3 Vbat R14 Vbat GND J4 PWM GND Ind 100n GND GND R6 1k A C7 100n am lc s on A te G nt st il Header 6 C19 100n U2 Index R15 nc CS1n RESn A0 R/W E D0 D1 D2 D3 D4 D5 D6 D7 VDD VSS Vout Cap3Cap1+ Cap1Cap2Cap2+ V1 V2 V3 V4 V5 VDD C86 GND 3.3V MagINCn MagDECn A B R7 nc GND Prog Ext_CLK DO CSn LCD_E Int_CLK LCD_RW LCD_A0 Inc DS4 MagINCn MagDECn A B Index 1 2 3 4 5 6 Analog_in C6 J1 1 2 LCD_A0 3 100n LCD_RW 4 LCD_E D7..0 5 D0 6 D1 7 D2 8 D3 9 D4 10 C8 D5 11 1u/16V D6 12 GND D7 13 14 R2 3V C9 15 nc GND 1u/16V 16 C10 17 1u/16V 18 C11 19 1u/16V 20 21 22 23 24 25 26 C12 C13 C14 C15 C16 27 3V 28 1u/16V 1u/16V 1u/16V 1u/16V 1u/16V GND GND R8 1k Dec J7 Index B A C3 3V R1 10k Shield 0 AS5045 - AS5145: - Populated: R15 = 1k - NA:DS5, DS6, DS7, R10, R11, R12 19 20 21 22 23 24 25 26 3V C8051F320 3.3V AS5145-I10 / AS5145-I12: - Populated: DS5, DS6, DS7, R10, R11, R12 - NA: R7, R15 D7 D6 D5 D4 D3 D2 D1 D0 27 28 29 30 31 32 1 2 P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0 5 SHLD P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0 11 12 13 14 15 16 17 18 al id C2 10u lv C1 100n 2 GND DO CLK CSn 3.3V 5V Prog 1 2 3 4 5 6 7 Ext_DO Ext_CLK Ext_CSn Prog DO GND INT_CSn 3.3V 5V CSn MCLSS22_DPDT Header 7 External encoder AS5x45-DB AS1360-30 C24 1u GND Te ch ni ca Figure 7: AS5x45/AS5145A/B-Ix Demoboard schematics Figure 8: AS5x45/AS5145A/B-Ix Demoboard PCB Layout Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 7 of 12 am lc s on A te G nt st il AS5145-Ixx only lv al id AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL Te ch ni ca Figure 9: AS5x45 Blockdiagramm Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 8 of 12 AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL Index General Overview.............................................................................................................................................................. 1 The AS5045/AS5145A/B Demoboard ............................................................................................................................... 1 Operating the AS5045/AS5145A/B Demoboard................................................................................................................ 2 3.1 Graphic LCD display................................................................................................................................................. 2 3.2 PWM LED ................................................................................................................................................................. 2 3.3 MagINc and MagDECn............................................................................................................................................. 3 3.4 Encoder selection switch .......................................................................................................................................... 4 4 AS5000 Programmer GUI software................................................................................................................................... 5 4.1 Installing the GUI on the PC ..................................................................................................................................... 5 4.2 The Home tab ........................................................................................................................................................... 5 4.3 The SSI tab............................................................................................................................................................... 7 4.4 The OTP tab ............................................................................................................................................................. 9 5 AS5045/AS5145A/B Demoboard, Schematics, Blockdiagramm ..................................................................................... 10 Index......................................................................................................................................................................................... 13 Revision History ....................................................................................................................................................................... 14 Contact ..................................................................................................................................................................................... 15 Copyright .................................................................................................................................................................................. 17 Te ch ni ca am lc s on A te G nt st il lv al id 1 2 3 Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 9 of 12 AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL Revision History Revision Date Description March 09, 2009 First version 1.1 March 25, 2009 Minor corrections 1.2 July 16, 2009 Add AS5145A/B-I10 and AS5145A/B-I12 1.3 July 22, 2009 Minor corrections Te ch ni ca am lc s on A te G nt st il lv al id 1.0 Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 10 of 12 AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL Contact Headquarters austriamicrosystems USA, Inc. austriamicrosystems Germany GmbH 8601 Six Forks Road Tegernseer Landstrasse 85 Suite 400 D-81539 Munchen, Germany Raleigh, NC 27615, USA Phone: +49 89 69 36 43 0 Phone: +1 919 676 5292 +49 89 69 36 43 66 Fax: +1 509 696 2713 Fax: austriamicrosystems USA, Inc. Via A. Volta, 18 4030 Moorpark Ave am lc s on A te G nt st il austriamicrosystems Italy S.r.l. lv Sales Offices al id austriamicrosystems AG A 8141 Schloss Premstatten, Austria Phone: +43 3136 500 0 Fax: +43 3136 525 01 industry.medical@austriamicrosystems.com www.austriamicrosystems.com Suite 116 I-20094 Corsico (MI), Italy Phone: +39 02 4586 4364 Fax: +39 02 4585 773 San Jose, CA 95117, USA Phone: +1 408 345 1790 Fax: +1 509 696 2713 austriamicrosystems France S.A.R.L. austriamicrosystems AG 124, Avenue de Paris F-94300 Vincennes, France Phone: +33 1 43 74 00 90 Fax: +33 1 43 74 20 98 austriamicrosystems Switzerland AG Rietstrasse 4 Suite 811, Tsimshatsui Centre East Wing, 66 Mody Road Tsim Sha Tsui East, Kowloon, Hong Kong Phone: +852 2268 6899 Fax: +852 2268 6799 CH 8640 Rapperswil, Switzerland austriamicrosystems AG Phone: +41 55 220 9008 AIOS Gotanda Annex 5th Fl., 1-7-11, Fax: +41 55 220 9001 Higashi-Gotanda, Shinagawa-ku Tokyo 141-0022, Japan 88, Barkham Ride, ca austriamicrosystems UK, Ltd. Phone: +81 3 5792 4975 Fax: +81 3 5792 4976 Finchampstead, Wokingham austriamicrosystems AG Phone: +44 118 973 1797 #805, Dong Kyung Bldg., Fax: +44 118 973 5117 824-19, Yeok Sam Dong, Kang Nam Gu, Seoul austriamicrosystems AG Korea 135-080 ch ni Berkshire RG40 4ET, United Kingdom Klaavuntie 9 G 55 Phone: +82 2 557 8776 FI 00910 Helsinki, Finland Fax: +82 2 569 9823 +358 9 72688 170 Fax: +358 9 72688 171 Te Phone: austriamicrosystems AG Singapore Representative Office austriamicrosystems AG 83 Clemenceau Avenue, #02-01 UE Square Bivagen 3B 239920, Singapore S 19163 Sollentuna, Sweden Phone: +65 68 30 83 05 Phone: Fax: +65 62 34 31 20 +46 8 6231 710 Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 11 of 12 AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL Copyright Devices sold by austriamicrosystems are covered by the warranty and patent indemnification provisions appearing in its Term of Sale. austriamicrosystems makes no warranty, express, statutory, implied, or by description regarding the information set forth herein or regarding the freedom of the described devices from patent infringement. austriamicrosystems reserves the right to change specifications and prices at any time and without notice. Therefore, prior to designing this product into a system, it is necessary to check with austriamicrosystems for current information. This product is intended for use in normal commercial applications. Te ch ni ca am lc s on A te G nt st il lv al id Copyright (c) 2009 austriamicrosystems. Trademarks registered (R). All rights reserved. The material herein may not be reproduced, adapted, merged, translated, stored, or used without the prior written consent of the copyright owner. To the best of its knowledge, austriamicrosystems asserts that the information contained in this publication is accurate and correct. However, austriamicrosystems shall not be liable to recipient or any third party for any damages, including but not limited to personal injury, property damage, loss of profits, loss of use, interruption of business or indirect, special, incidental or consequential damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical data herein. No obligation or liability to recipient or any third party shall arise or flow out of austriamicrosystems rendering of technical or other services. Revision 1.3, 22-Jul-2009 www.austriamicrosystems.com Page 12 of 12 Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: ams: AS5145B DB